<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script>
      function show(){
            var sushu=document.getElementById('sushu').value;
            isPrime(sushu)?alert(base+' 是素数'):alert(sushu+' 不是素数');
        }
        function isPrime(number) {
            if (number < 2) {
                return false;
            } else {
                for (var j = 2; j <= Math.sqrt(number); j++) {
                    if (number % j == 0) {
                        return false;
                    }
                }
            }
            return true;
        }
        </script>
</head>
<body style="font-size:12px;">
数字<input type='input' id='sushu' onkeyup='filter(this)' onbeforepaste="filter2()"/>
<br>
<input type="button" value="素数?" onclick="show();">

</body>
</html>